import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    port: 8000,
    // host: 'sm.mpsass.com',
    host: '0.0.0.0',
    hmr: true,
    open: true,
    https: false,
    proxy: {
      '/api': {
        // target: 'http://120.48.24.52:3000',
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    },
  },
})
